<script setup lang='ts'>
import { onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
onMounted(() => {
    const route = useRoute()
    // alert(JSON.stringify(route.query))
    alert(JSON.stringify(route.params))

})
const router = useRouter() //自定义hook的特性 必须在最顶层声明才可以使用
const back = () => {

    router.back()
}

</script>

<template>
    <h1>首页</h1>
    <button @click="back">返回</button>
</template>

<style scoped></style>